function objectFactory(){
    let obj ={};
    var Constructor=[].shift.call(arguments);
    obj.__proto__=Constructor.prototype;
    var ret=Constructor.apply(obj,arguments);
    // return ret? ret:obj;
    return typeof ret ==='object'? ret || obj :obj;
}
function Person(name,age){
    this.name=name;
    this.age=age;
    return {
        name,
        age,
        bb:'11'
    }
}

let p=objectFactory(Person,'yy',20);
console.log(p.bb);